import { contextBridge, ipcRenderer, IpcRendererEvent } from 'electron';

// 定义类型
type Callback = (event: IpcRendererEvent, ...args: unknown[]) => void;

contextBridge.exposeInMainWorld('electronAPI', {
  invoke: (channel: any, args: any) => ipcRenderer.invoke(channel, args),
  // send: (channel, args) => ipcRenderer.send(channel, args),
  // on: (channel, listener) => {
  //   ipcRenderer.on(channel, listener);
  //   return () => ipcRenderer.removeListener(channel, listener);
  // },
});